from django.urls import path
from apps.users.views import UsernameCountView, MobileCountView, RegisterView, LoginView, LogoutView, CenterView, \
                        EmailView, EmailVerifyView, AddressCreateView, AddressView, AddressSetDefaultView, \
                        AddressChangeAliasView, AddressDetailView

urlpatterns = [
    # 判断用户名是否重复
    path('usernames/<username:uname>/count/', UsernameCountView.as_view()),
    # 判断手机号是否重复
    path('mobiles/<mobile:mid>/count/', MobileCountView.as_view()),
    # 用户注册
    path('register/', RegisterView.as_view()),
    # 用户登陆
    path('login/', LoginView.as_view()),
    # 用户注销.
    path('logout/', LogoutView.as_view()),
    # 用户中心.
    path('info/', CenterView.as_view()),
    # 邮箱.
    path('emails/', EmailView.as_view()),
    # 邮箱验证
    path('emails/verification/', EmailVerifyView.as_view()),

    # 收货地址创建
    path('addresses/create/', AddressCreateView.as_view()),
    # 收货地址查询
    path('addresses/', AddressView.as_view()),
    # 设置默认收货地址
    path('addresses/<int:id>/default/', AddressSetDefaultView.as_view()),
    # 更改别名
    path('addresses/<int:id>/title/', AddressChangeAliasView.as_view()),
    # 修改地址
    path('addresses/<int:id>/', AddressDetailView.as_view()),
]
